class Solution {
public:
    vector<string> splitWordsBySeparator(vector<string>& words, char separator) {
        vector<string> ans;
        for (auto x : words) {
            string s;
            for (auto y : x) {
                if (y != separator) {
                    s += y;
                }
                else {
                    if (s != "")ans.push_back(s);
                    s = "";
                }
            }
            if (s != "")ans.push_back(s);
        }
        return ans;
    }
};